import {
    addcompany,
    addother_business,
    renewalorder,
    renewalsubmit,
    renewalsubmits,
    renewalretry,
    renewalcancel,
    addpaymentorder,
    editcompany,
    addactivity,
    editactivity,
    dispatchrefuse,
    renewalrefuse,
    accountrefuse,
    cashierrefuse,
    accountrefuses,
    dispatchretry,
    accountretry,
    cashierretry,
    accountretrys,
    deletepaymentorder,
    dispatchsubmit,
    accountcache,
    accountsubmit,
    cashiersubmit,
    accountsubmits,
    paymentordercash,
    payment_take,
    editpayment_take,
    deletepayment_take,
    base_salary,
    editbase_salary,
    deletebase_salary,
    open_account,
    editopen_account,
    deleteopen_account,
    other_business_take,
    editother_business_take,
    receiver_submit,
    coordination_submit,
    auxiliary_coordination_submit,
    set_register

} from '@/services/business';

const UserModel = {
    namespace: 'business',
    state: {
        currentUser: {},
    },
    effects: {
        * addcompany({ payload }, { call, put }) {
            const response = yield call(addcompany, payload);
            return response
        },
        * addother_business({ payload }, { call, put }) {
            const response = yield call(addother_business, payload);
            return response
        },
        * renewalorder({ payload }, { call, put }) {
            const response = yield call(renewalorder, payload);
            return response
        },
        * renewalsubmit({ payload }, { call, put }) {
            const response = yield call(renewalsubmit, payload);
            return response
        },
        * renewalsubmits({ payload }, { call, put }) {
            const response = yield call(renewalsubmits, payload);
            return response
        },
        * renewalretry({ payload }, { call, put }) {
            const response = yield call(renewalretry, payload);
            return response
        },
        * renewalcancel({ payload }, { call, put }) {
            const response = yield call(renewalcancel, payload);
            return response
        },
        * deletepaymentorder({ payload }, { call, put }) {
            const response = yield call(deletepaymentorder, payload);
            return response
        },
        * addpaymentorder({ payload }, { call, put }) {
            const response = yield call(addpaymentorder, payload);
            return response
        },
        * editcompany({ payload }, { call, put }) {
            const response = yield call(editcompany, payload);
            return response
        },
        * addactivity({ payload }, { call, put }) {
            const response = yield call(addactivity, payload);
            return response
        },
        * editactivity({ payload }, { call, put }) {
            const response = yield call(editactivity, payload);
            return response
        },
        * dispatchrefuse({ payload }, { call, put }) {
            const response = yield call(dispatchrefuse, payload);
            return response
        },
        * renewalrefuse({ payload }, { call, put }) {
            const response = yield call(renewalrefuse, payload);
            return response
        },
        * accountrefuse({ payload }, { call, put }) {
            const response = yield call(accountrefuse, payload);
            return response
        },
        * accountrefuses({ payload }, { call, put }) {
            const response = yield call(accountrefuses, payload);
            return response
        },
        * cashierrefuse({ payload }, { call, put }) {
            const response = yield call(cashierrefuse, payload);
            return response
        },
        * cashierretry({ payload }, { call, put }) {
            const response = yield call(cashierretry, payload);
            return response
        },
        * dispatchretry({ payload }, { call, put }) {
            const response = yield call(dispatchretry, payload);
            return response
        },
        * accountretrys({ payload }, { call, put }) {
            const response = yield call(accountretrys, payload);
            return response
        },
        * accountretry({ payload }, { call, put }) {
            const response = yield call(accountretry, payload);
            return response
        },
        * dispatchsubmit({ payload }, { call, put }) {
            const response = yield call(dispatchsubmit, payload);
            return response
        },
        * accountcache({ payload }, { call, put }) {
            const response = yield call(accountcache, payload);
            return response
        },
        * accountsubmit({ payload }, { call, put }) {
            const response = yield call(accountsubmit, payload);
            return response
        },
        * accountsubmits({ payload }, { call, put }) {
            const response = yield call(accountsubmits, payload);
            return response
        },
        * cashiersubmit({ payload }, { call, put }) {
            const response = yield call(cashiersubmit, payload);
            return response
        },
        * paymentordercash({ payload }, { call, put }) {
            const response = yield call(paymentordercash, payload);
            return response
        },
        * payment_take({ payload }, { call, put }) {
            const response = yield call(payment_take, payload);
            return response
        },
        * editpayment_take({ payload }, { call, put }) {
            const response = yield call(editpayment_take, payload);
            return response
        },
        * deletepayment_take({ payload }, { call, put }) {
            const response = yield call(deletepayment_take, payload);
            return response
        },
        * base_salary({ payload }, { call, put }) {
            const response = yield call(base_salary, payload);
            return response
        },
        * editbase_salary({ payload }, { call, put }) {
            const response = yield call(editbase_salary, payload);
            return response
        },
        * deletebase_salary({ payload }, { call, put }) {
            const response = yield call(deletebase_salary, payload);
            return response
        },
        * open_account({ payload }, { call, put }) {
            const response = yield call(open_account, payload);
            return response
        },
        * editopen_account({ payload }, { call, put }) {
            const response = yield call(editopen_account, payload);
            return response
        },
        * deleteopen_account({ payload }, { call, put }) {
            const response = yield call(deleteopen_account, payload);
            return response
        },
        * other_business_take({ payload }, { call, put }) {
            const response = yield call(other_business_take, payload);
            return response
        },
        * editother_business_take({ payload }, { call, put }) {
            const response = yield call(editother_business_take, payload);
            return response
        },
        * receiver_submit({ payload }, { call, put }) {
            const response = yield call(receiver_submit, payload);
            return response
        },
        * coordination_submit({ payload }, { call, put }) {
            const response = yield call(coordination_submit, payload);
            return response
        },
        * auxiliary_coordination_submit({ payload }, { call, put }) {
            const response = yield call(auxiliary_coordination_submit, payload);
            return response
        },
        * set_register({ payload }, { call, put }) {
            const response = yield call(set_register, payload);
            return response
        }
    },
    reducers: {
        saveCurrentUser(state, action) {
            return { ...state, ...action.payload };
        }
    },
};
export default UserModel;